<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

use Illuminate\View\View;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        view()->composer('*', function (View $view) {
			$checkLogin = Auth::guard('web')->user();
			if(!empty($checkLogin)) {
				$memuRule = $checkLogin->getUserRules();
				$view->with('menuRule', $memuRule);
			}
        });
    }  

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
